<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{$smarty.const.Site_Name}</title>
<link href="css/public.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="Js/menu.js"></script>
<script type="text/javascript" src="Js/string.js"></script>
<script type="text/javascript" src="Js/product.js"></script>
<script type="text/javascript" src="Js/exec.js"></script>
<script type="text/javascript" src="Js/Calendar.js"></script>
</head>

<body>
{include file="header.html"}
<div class="center">
	<div class="left">{include file="menu.html"}</div>
	<div class="right">
		<div class="Nav">
			{if $get.go}
			<div>
				产品状态
				<a href="{write_url url=$thisurl DEL='status'}" {if $get.status == ''}class='red'{/if}>全部</a>
				{foreach item=us key=uy from=$status}
				<a href="{write_url url=$thisurl status=$uy}" {if $get.status == $uy}class='red'{/if}>{$us}</a>
				{/foreach}
			</div>
			{/if}
			<ul>
			{if $BTP[$get.open].advanced}<li><a href="{write_url url=$thisurl action='advanced' DEL='ALL'}" {CLASS_COLOR advanced=$get.action CLASS='this'}>高级查询</a></li>{/if}
			{if $BTP[$get.open].add}<li><a href="{write_url url=$thisurl action='add' DEL='ALL'}" {CLASS_COLOR add=$get.action CLASS='this'}>添加产品</a></li>{/if}
			{if $BTP[$get.open].show}<li><a href="{write_url url=$thisurl action='show' DEL='ALL'}" {CLASS_COLOR show=$get.action CLASS='this'}>产品管理</a></li>{/if}
			</ul>
			<span class="clear"></span>
		</div>
		{if $get.go}
		<div class="show">
			<form action="{write_url url=$thisurl action='del'}" method="post">
				<table width="100%" border="0" cellspacing="1" cellpadding="0" id="tab_show">
					<tr>
						<th width="5%">选择</th>
						<th>编号</th>
						<th>形状</th>
						<th>重量</th>
						<th>颜色</th>
						<th>净度</th>
						<th>切工</th>
						<th>抛光</th>
						<th>对称</th>
						<th>荧光</th>
						<th>测量值</th>
						<th>证书</th>
						<th>¥/每卡</th>
						<th>退点%</th>
						<th>¥/每颗</th>
						<th width="5%">价格</th>
						<th width="5%">详情</th>
						<th width="5%">编辑</th>
						<th width="5%">删除</th>
					</tr>
					{foreach item=pso from=$list_text}
					<tr align="center">
						<td>{if $BTP[$get.open].del}<input type="checkbox" name="id[]" value="{$pso.id}" />{/if}</td>
						<td>{brite_spot query =$get.info str=$pso.ProID}</td>
						<td>{$shape[$pso.shape]}</td>
						<td>{$pso.weight}</td>
						<td>{$pso.color}</td>
						<td>{$pso.clarity}</td>
						<td>{$pso.cut}</td>
						<td>{$pso.buffing}</td>
						<td>{$pso.symmetry}</td>
						<td>{$pso.Fent_Isity}</td>
						<td>{$pso.scalar_value}</td>
						<td>{Goto_diploma diploma=$pso.diploma weight=$pso.weight NO=$pso.diplomaNO show=$pso.diploma}</td>
						<td>{math equation="x / y" x=$pso.infml y=$pso.weight format="%.2f"}</td>
						{if $pso.is_promotion == 'Y' and $pso.promotion_start <= mktime() and $pso.promotion_stop >= mktime()}
						<td class="promotion">促销</td>
						<td class="promotion">{sprintf('%.2f' , $pso.INTbid*$pso.weight*(100+$pso.agio+$pso.baseAgio+$pso.promotion_dot)/100)} 元</td>
						{else}
						<td>{$pso.agio}</td>
						<td>{$pso.infml}</td>
						{/if}
						<td class="action">{if $BTP[$get.open].view_price}<a href="javascript:;" onclick="view_price(this , '{$pso.id}' , 19)" class="act_3_2" title="查看价格"></a>{/if}</td>
						<td class="action">{if $BTP[$get.open].detail}<a href="javascript:;" onclick="show_pro_detail(this , '{$pso.id}' , 19)" class="act_3_10" title="产品详情"></a>{/if}</td>
						<td class="action">{if $BTP[$get.open].edit}<a href="{write_url url=$thisurl action='edit' id=$pso.id}" class="act_5_8" title="编辑"></a>{/if}</td>
						<td class="action">{if $BTP[$get.open].del}<a href="{write_url url=$thisurl action='del' id=$pso.id}" class="act_1_5" title="删除"></a>{/if}</td>
					</tr>
					{foreachelse}
					<tr><td colspan="19" class="else">当前没有你搜索的产品 , <a href="{write_url url=$thisurl action='add' DEL='ALL'}">点击添加产品</a></td></tr>
					{/foreach}
				</table>
				<div class="select">
				{if $BTP[$get.open].del}
					选择：
					<input value="全部选择" type="button" onclick="select_all('id[]');" />
					<input value="全部取消" type="button" onclick="select_out('id[]');" />
					<input value="反向选择" type="button" onclick="select_agt('id[]');" />
					<input value="删除选择" type="button" onclick="select_del('id[]' , this);" />
				{/if}
				{if $BTP.cart.add}<input value="加入购物车" type="button" onclick="add_cart('id[]',this,'{write_url url=$thisurl open='cart' action='add' DEL='ALL'}')" />{/if}
				{if $BTP.product_to_CSV.add}<input value="导出CSV" type="button" onclick="add_cart('id[]',this,'{write_url url=$thisurl open='product_to_CSV' action='add' DEL='ALL'}')" />{/if}
				</div>
			</form>
			{if $list_page.Record > 0}
			<div class="page">
				每页
				<select onchange="page_Local(this,0 , '{write_url url=$thisurl DEL='PNS'}')">
					<option value="PNS=10" {selected val=$get.PNS str='10'}>10</option>
					<option value="PNS=25" {selected val=$get.PNS str='25'}>25</option>
					<option value="PNS=50" {selected val=$get.PNS str='50'}>50</option>
					<option value="PNS=100" {selected val=$get.PNS str='100'}>100</option>
				</select>
				条数据
				当前第{$list_page.NowPage}页 / 共{$list_page.count}页
				{if $list_page.NowPage > 1}<a href="{write_url url=$thisurl page='1'}">首页</a>{else}首页{/if}
				{if $list_page.NowPage > 1}<a href="{write_url url=$thisurl page=$list_page.up}">上一页</a>{else}上一页{/if}
				{if $list_page.NowPage < $list_page.count}<a href="{write_url url=$thisurl page=$list_page.down}">下一页</a>{else}下一页{/if}
				{if $list_page.NowPage < $list_page.count}<a href="{write_url url=$thisurl page=$list_page.count}">尾页</a>{else}尾页{/if}
				至 <input type="text" value="{$list_page.NowPage}" onkeydown="go_page(event , this , '{$thisurl}')" /> 页
				排序:
				<select onchange="page_Local(this,0 , '{write_url url=$thisurl DEL='ORDER'}')">
					<option value="ORDER=agio_UP" {selected val=$get.ORDER str='agio_UP'}>按 退点 (↑) 排序</option>
					<option value="ORDER=agio_Dn" {selected val=$get.ORDER str='agio_Dn'}>按 退点 (↓) 排序</option>
					<option value="ORDER=nber_UP" {selected val=$get.ORDER str='nber_UP'}>按 编号 (↑) 排序</option>
					<option value="ORDER=nber_Dn" {selected val=$get.ORDER str='nber_Dn'}>按 编号 (↓) 排序</option>
					<option value="ORDER=inml_UP" {selected val=$get.ORDER str='inml_UP'}>按 价格 (↑) 排序</option>
					<option value="ORDER=inml_Dn" {selected val=$get.ORDER str='inml_Dn'}>按 价格 (↓) 排序</option>
				</select>
			</div>
			{/if}
		</div>
		{else}
		<div class="append">
			<form action="{write_url url=$thisurl go='query'}" method="post">
				<table width="100%" border="0" cellspacing="1" cellpadding="0">
					<tr>
						<th>形状</th>
						<th>颜色</th>
						<th>净度</th>
						<th>切工</th>
						<th>抛光</th>
						<th>对称</th>
						<th>荧光强度</th>
						<th>荧光颜色</th>
						<th>证书</th>
						<th>产品来源</th>
					</tr>
					<tr class="Advanced">
						<td>
							{foreach item=ts key=sy from=$shape}
							<label for="shape_{$sy}"><input name="shape[]" type="checkbox" id="shape_{$sy}" value="{$sy}" {checked val=$sy str=$get.shape} /> {$ts}</label>
							{/foreach}
						</td>
						<td>
							{foreach item=ts from=$color}
							<label for="color_{$ts}"><input name="color[]" type="checkbox" id="color_{$ts}" value="{$ts}" {checked val=$ts str=$get.color} /> {$ts}</label>
							{/foreach}
						</td>
						<td>
							{foreach item=ts from=$clarity}
							<label for="clarity_{$ts}"><input name="clarity[]" type="checkbox" id="clarity_{$ts}" value="{$ts}" {checked val=$ts str=$get.clarity} /> {$ts}</label>
							{/foreach}
						</td>
						<td>
							{foreach item=ts from=$cut}
							<label for="cut_{$ts}"><input name="cut[]" type="checkbox" id="cut_{$ts}" value="{$ts}" {checked val=$ts str=$get.cut} /> {$ts}</label>
							{/foreach}
						</td>
						<td>
							{foreach item=ts from=$cut}
							<label for="buffing_{$ts}"><input name="buffing[]" type="checkbox" id="buffing_{$ts}" value="{$ts}" {checked val=$ts str=$get.buffing} /> {$ts}</label>
							{/foreach}
						</td>
						<td>
							{foreach item=ts from=$cut}
							<label for="symmetry_{$ts}"><input name="symmetry[]" type="checkbox" id="symmetry_{$ts}" value="{$ts}" {checked val=$ts str=$get.symmetry} /> {$ts}</label>
							{/foreach}
						</td>
						<td>
							{foreach item=ts from=$Fent_Isity}
							<label for="Fent_Isity_{$ts}"><input name="Fent_Isity[]" type="checkbox" id="Fent_Isity_{$ts}" value="{$ts}" {checked val=$ts str=$get.Fent_Isity} /> {$ts}</label>
							{/foreach}
						</td>
						<td>
							{foreach item=ts from=$Fent_color}
							<label for="Fent_color_{$ts}"><input name="Fent_color[]" type="checkbox" id="Fent_color_{$ts}" value="{$ts}" {checked val=$ts str=$get.Fent_color} /> {$ts}</label>
							{/foreach}
						</td>
						<td>
							{foreach item=ts from=$diploma}
							<label for="diploma_{$ts}"><input name="diploma[]" type="checkbox" id="diploma_{$ts}" value="{$ts}" {checked val=$ts str=$get.diploma} /> {$ts}</label>
							{/foreach}
						</td>
						<td>
							{foreach item=ts key=sy from=$proSource}
							<label for="proSource_{$sy}"><input name="proSource[]" type="checkbox" id="proSource_{$sy}" value="{$sy}" {checked val=$sy str=$get.proSource} /> {$ts}</label>
							{/foreach}
						</td>
					</tr>
					<tr>
						<td colspan="4" align="right">促销</td>
						<td colspan="6" class="promotion">
							<ul style="display:block">
								<li>
									开始时间 <input name='promotion_start' type="text" class="FM_date" onclick="Calendar(this)" value="{$get.promotion_start|date_format:'%Y-%m-%d'}" readonly />
									<a href="javascript:;" class="DELDAY" onclick="DELDAY('promotion_start');">删除</a>
								</li>
								<li>
									结束时间 <input name='promotion_stop' type="text" class="FM_date" onclick="Calendar(this)" value="{$get.promotion_stop|date_format:'%Y-%m-%d'}" readonly />
									<a href="javascript:;" class="DELDAY" onclick="DELDAY('promotion_stop');">删除</a>
								</li>
							</ul>
						</td>
					</tr>
					<tr>
						<td colspan="4" align="right">退点</td>
						<td colspan="6">
							<input name="agio[]" type="text" style="width:80px;text-align:center" onfocus="sprintf('%.2f' , this , true)" /> % -
							<input name="agio[]" type="text" style="width:80px;text-align:center" onfocus="sprintf('%.2f' , this , true)" /> %
						</td>
					</tr>
					<tr>
						<td colspan="4" align="right">重量</td>
						<td colspan="6">
							<input name="weight[]" type="text" style="width:80px;text-align:center" onfocus="sprintf('%.2f' , this , true)" /> ct -
							<input name="weight[]" type="text" style="width:80px;text-align:center" onfocus="sprintf('%.2f' , this , true)" /> ct
						</td>
					</tr>
					<tr>
						<td colspan="4" align="right">全身比</td>
						<td colspan="6">
							<input name="body_ratio[]" type="text" style="width:80px;text-align:center" onfocus="sprintf('%.2f' , this , true)" /> % -
							<input name="body_ratio[]" type="text" style="width:80px;text-align:center" onfocus="sprintf('%.2f' , this , true)" /> %
						</td>
					</tr>
					<tr>
						<td colspan="4" align="right">台宽比</td>
						<td colspan="6">
							<input name="table_width[]" type="text" style="width:80px;text-align:center" onfocus="sprintf('%.2f' , this , true)" /> % -
							<input name="table_width[]" type="text" style="width:80px;text-align:center" onfocus="sprintf('%.2f' , this , true)" /> %
						</td>
					</tr>
					<tr><th colspan="10" align="center"><input type="submit" value=" 查 询 " /> <input type="reset" value=" 重 填 " /></th></tr>
				</table>
			</form>
		</div>
		{/if}
	</div>
	<b class="clear"></b>
</div>
</body>
</html>